module.exports =(options, app) => {
  return async(ctx, next) => {
    let userinfo =await ctx.session('userinfo');
    const OuahUrl='http://newwx.ompchina.net/api/oauth2?scope=snsapi_userinfo&appid=wx58925cabd0e5f16d&returnurl=http://hrwxh5.ompchina.net/callBack';
    if (think.isEmpty(userinfo)){
      return ctx.redirect(OuahUrl);
    }
    return next();
  };
};
